Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General housekeeping #35

Merged
merged 6 commits into from
Nov 23, 2022
Merged

General housekeeping #35

merged 6 commits into from
Nov 23, 2022

Conversation

Cruikshanks
Copy link
Member

@Cruikshanks Cruikshanks commented Nov 23, 2022

In this change, we're just getting on top of some basic things we've either omitted when making changes or because we have made a conscious decision about a way forward.

  • Using kebab-case rather than snake_case for filenames
    • Though there is no standard or rule, it's our opinion that most javascript projects use kebab-case
  • Ensuring all require() statements include the extension
  • Including module JSDoc comments at the top of each file
    • We use JSDoc to comment our methods. It also recommends CommonJS modules should include a standalone comment. When you do, VSCode will display the info when you hover over a require()
  • Ensuring the top of our files, where we do our requiring etc is consistent throughout
    • Sometimes its good to have a set structure, as it removes any hesitation or stress from deciding things that don't actually matter, so you can focus on the things that do

For reference, our convention at the top of files is

  • use strict
  • @module tag
  • external dependencies
  • internal modules
  • config
  • constants

With a new line between each section

In this change we're just getting on top of some basic things we've either ommitted when making changes or because we have made a concious decision about a way forward.

- Using kebab-case rather than snake_case for filenames
  - Though there is no standard or rule, it's our opinion that most javascript projects use kebab-case
- Ensuring all require statements include the extension
  - We know it's not needed. But as [Switch from CommonJS to ES6 modules](#9) shows, we really want to switch to imports one day and this will set us up for that
- Including module JSDoc comments at the top of each file
  - We use JSDoc to comment our methods. I also reccommends CommonJS modules should include a standalone comment. When you do, VSCode will display the info when you hover over a `require()`
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Nov 23, 2022
@Cruikshanks Cruikshanks self-assigned this Nov 23, 2022
Our convention is

- `use strict`
- `@module` tag
- external dependencies
- internal modules
- config
- constants

With a new line between each section
@Cruikshanks Cruikshanks marked this pull request as ready for review November 23, 2022 23:33
@Cruikshanks Cruikshanks merged commit d81c287 into main Nov 23, 2022
@Cruikshanks Cruikshanks deleted the housekeeping branch November 23, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant